const mongoose = require('mongoose');

// 检查模型是否已经被编译
const getModel = (modelName) => {
  return mongoose.models[modelName] || mongoose.model(modelName);
};

// 导出所有模型
module.exports = {
  Product: require('./product'),
  Category: mongoose.models.Category || require('./Category'),
  Brand: mongoose.models.Brand || require('./brand')
}; 